package com.wxzz.elearing.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wxzz.elearing.user.entity.Docent;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Optional;

/**
 * @author zhangjunjie
 */
public interface DocentMapper extends BaseMapper<Docent> {

    @Select("SELECT * FROM `docent` WHERE admin_user_id = #{adminUserId} AND deleted = 0")
    Optional<Docent> selectOneByAdminUserId(@Param("adminUserId") Long adminUserId);

    @Select("SELECT * FROM `docent` WHERE wx_user_id = #{wxUserId} AND deleted = 0")
    Optional<Docent> selectOneByWxUserId(@Param("wxUserId") Long wxUserId);
}
